<?php
// Menu
$page = $module->page();
$menu = $module->menu();
$depth = $module->depth();
?>

<?php if( !$module->error ): ?>

<ul class="<?= $module->menuclass ?>">
  <?php foreach( $menu->getChildren( $depth ) as $m ): ?>
  <?= partial( 'liriope', 'menuitem', array(
    'hasChildren'=>$m->hasChildren(),
    'isActive'=>$m->isActive(),
    'url'=>$m->getURL(),
    'label'=>$m->getLabel(),
    'children'=>$m->getChildren( $depth ),
    'depth'=>$depth
  )) ?>
  <?php endforeach ?>
</ul>

<?php else: ?>
<h1>Woops!</h1>
<?php endif ?>
